package com.tvunetworks.center.user.controller;

import com.tvunetworks.center.common.util.Result;
import com.tvunetworks.center.common.util.ResultUtil;
import com.tvunetworks.center.user.model.param.AddOrRemoveUserRoleMenuParam;
import com.tvunetworks.center.user.service.UserRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @program: tvucc-aggregator
 * @description: UserRoleMenuController
 * @author lebronchen
 * @create: 2019-07-05 14:42
 **/
@RestController
@RequestMapping("/userRoleMenu")
public class UserRoleMenuController {

    @Autowired
    private UserRoleMenuService userRoleMenuService;

    /**
     * 增加用户权限
     * @param param param
     * @return Result
     */
    @PostMapping("/add")
    public Result<Object> addOrRemoveUserRoleMenu(@Valid AddOrRemoveUserRoleMenuParam param){
        userRoleMenuService.addOrRemoveUserRoleMenu(param);
        return ResultUtil.success();
    }
}
